package com.mz.demo.utils.tools;


import java.util.Random;

public class ValidateCodeGenerate {

    public static Random random = new Random();

    public static String generateValidateCode( Integer length ){

        if( length == null ){
            length = 6;
        }

        StringBuffer content = new StringBuffer();
        for( int i=0; i < length; i++ ){
            content.append( random.nextInt(10) );
        }
        return content.toString();
    }
}
